package com.mingzhi.rabbitmq.listener;

import com.mingzhi.rabbitmq.constant.Constants;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void listenerQueue1(Message message, Channel channel){
        System.out.println("work queue1 message:"+ message +  ",channel:" + channel);
    }

   /* @RabbitListener(queues = Constants.WORK_QUEUE)
    public void listenerQueue2(String message){
        System.out.println("work queue2 message:"+ message);
    }*/

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void listenerQueue3(Message message){
        System.out.println("work queue3 message:"+ message);
    }

}
